#!/bin/bash
# 参考(https://zhuanlan.zhihu.com/p/143533486)
pwd=$(pwd)
if [ -d $HOME/.local/share/nautilus/scripts ];
then 
    cd $HOME/.local/share/nautilus/scripts
else
    echo "no nautilus folder detected, exiting"
    exit -1
fi

echo "#!/bin/bash" > Vscode_it
echo -e "code \$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" >> Vscode_it
sudo chmod u+x Vscode_it
cd $pwd